package com.corpgovernment.supplier.enums;
//1：国内机票，2：国内酒店，3：火车票，4：用车
public enum ProductTypeForIdEnum {
    flight(1,"国内机票",1),
    train(2,"火车票",3),
    hotel(3,"国内酒店",4),
    car(4,"用车",5),
    intlflight(5,"国际机票",2),
    airportTransfer(6,"接送机",6),
    trainTransfer(7,"接送站",7),
    hotelintl(8,"海外酒店",8);

    ProductTypeForIdEnum(Integer id, String desc, Integer orderNum){
     this.id = id;
     this.desc = desc;
     this.orderNum=orderNum;
    }

    private int id;
    private int orderNum;
    private String desc;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public int getOrderNum() {
        return orderNum;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public  static  String  getName(int id){
        if(flight.getId()==id){
            return flight.name();
        }
        if(train.getId()==id){
            return train.name();
        }
        if(hotel.getId()==id){
            return hotel.name();
        }
        if(car.getId() == id){
            return car.name();
        }
        if(intlflight.getId() == id){
            return intlflight.name();
        }
        if (airportTransfer.getId() == id){
            return airportTransfer.name();
        }
        if (trainTransfer.getId() == id)
        {
            return trainTransfer.name();
        }
        if (hotelintl.getId() == id)
        {
            return hotelintl.name();
        }
        return null;
    }
    public  static  String  getDesc(String name){
        if(flight.name().equalsIgnoreCase(name)){
            return flight.getDesc();
        }
        if(train.name().equalsIgnoreCase(name)){
            return train.getDesc();
        }
        if(hotel.name().equalsIgnoreCase(name)){
            return hotel.getDesc();
        }
        if(car.name().equalsIgnoreCase(name)){
            return car.getDesc();
        }
        if(intlflight.name().equalsIgnoreCase(name)){
            return intlflight.getDesc();
        }
        if (airportTransfer.name().equalsIgnoreCase(name)){
            return airportTransfer.getDesc();
        }
        if (trainTransfer.name().equalsIgnoreCase(name))
        {
            return trainTransfer.getDesc();
        }
        if (hotelintl.name().equalsIgnoreCase(name))
        {
            return hotelintl.getDesc();
        }
        return null;
    }
    public  static  Integer  getKey(String name){
        if(flight.name().equals(name)){
            return flight.getId();
        }
        if(train.name().equals(name)){
            return train.getId();
        }
        if(hotel.name().equals(name)){
            return hotel.getId();
        }
        if(car.name().equals(name)){
            return car.getId();
        }
        if(intlflight.name().equals(name)){
            return intlflight.getId();
        }
        if (airportTransfer.name().equals(name)){
            return airportTransfer.getId();
        }
        if (trainTransfer.name().equals(name)){
            return trainTransfer.getId();
        }
        if (hotelintl.name().equals(name)){
            return hotelintl.getId();
        }
        return null;
    }
}
